Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: gpio: retire pca95xx and pca953x driver #78274

Conversation

CkovMk
Copy link
Contributor

@CkovMk CkovMk commented Sep 11, 2024

pca95xx and pca953x driver can be replaced by pca_series driver, which covers a larger number of devices.

This is a follow-on to #69333

@zephyrbot zephyrbot added platform: Microchip MEC Microchip MEC Platform platform: NXP Drivers NXP Semiconductors, drivers area: GPIO labels Sep 11, 2024
@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch 2 times, most recently from 6ba48cd to a293fb1 Compare September 11, 2024 10:30
@CkovMk CkovMk marked this pull request as draft September 13, 2024 02:51
@henrikbrixandersen
Copy link
Member

Duplicate of #78273?

@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch from a293fb1 to 02778b2 Compare September 18, 2024 02:44
@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 18, 2024

@henrikbrixandersen No, they are for different part_no, one for pca95xx anb one for pca953x. There are 2 drivers in zephyr tree. That's why I came up the idea to create an unified driver back then.

@henrikbrixandersen
Copy link
Member

@henrikbrixandersen No, they are for different part_no, one for pca95xx anb one for pca953x. There are 2 drivers in zephyr tree. That's why I came up the idea to create an unified driver back then.

Could we handle them in the same PR, please? The comments for one of these will likely apply to both.

@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 18, 2024

Sure, will merge into this pr. I'll also add other drivers that could be replaced into this pr.

@CkovMk CkovMk changed the title drivers: gpio: retire pca95xx driver drivers: gpio: retire pca95xx and pca953x driver Sep 18, 2024
@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch 3 times, most recently from ef5c49a to 5a6c369 Compare September 19, 2024 06:12
@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 19, 2024

Update: add support for PCA957x, PCAL953x and PCAL64xxA, retire original pcal64xxa driver.

Note: The original pcal64xxa driver supports "no-auto-reset" boolean property that preserves register content on reinitialization, but no code in zephyr tree is using it. Currently pca_series driver does not implement such feature, but should be easy to add. Let me know if such feature is required.

@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch from cd2238c to eab3ba8 Compare September 19, 2024 07:37
@CkovMk CkovMk marked this pull request as ready for review September 20, 2024 03:20
@zephyrbot zephyrbot added platform: TI SimpleLink Texas Instruments SimpleLink MCU platform: Ezurio labels Sep 20, 2024
Copy link
Member

@rerickson1 rerickson1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change should make it in the release notes, etc. to highlight this.
Something to the effect of:
The old drivers were removed and replaced with an API equivalent driver that was already in the tree.

@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Sep 24, 2024
@CkovMk CkovMk requested a review from rerickson1 September 24, 2024 02:57
@dleach02
Copy link
Member

@rerickson1 did @CkovMk update to release notes address your concern?

dleach02
dleach02 previously approved these changes Sep 24, 2024
@CkovMk
Copy link
Contributor Author

CkovMk commented Sep 26, 2024

@dleach02 You may want to be cautious on approving / merging this pr. I don't have access to these boards that I've done changes on, so I cannot test my changes on real hardware. All I can guarantee is that this driver works for some part_no it claims compatible to (namely pca9538 and pcal6524) on i.MX 93 EVK, and I tested API for all GPIO_PCA_SERIES_FLAG_x configurations using pcal6524 to emulate other parts. (pcal6524 is "full-featured" and has all registers, can be used to emulate other parts ignoring the reg address difference.)

@dleach02
Copy link
Member

dleach02 commented Oct 1, 2024

@dleach02 You may want to be cautious on approving / merging this pr. I don't have access to these boards that I've done changes on, so I cannot test my changes on real hardware. All I can guarantee is that this driver works for some part_no it claims compatible to (namely pca9538 and pcal6524) on i.MX 93 EVK, and I tested API for all GPIO_PCA_SERIES_FLAG_x configurations using pcal6524 to emulate other parts. (pcal6524 is "full-featured" and has all registers, can be used to emulate other parts ignoring the reg address difference.)

I understand. Need to somehow move this PR along though so if there is a suggestion then please provide it.

@dleach02
Copy link
Member

@CkovMk what do you want to do with this PR?

@dleach02 dleach02 dismissed their stale review October 21, 2024 17:59

Awaiting disposition from author

@CkovMk
Copy link
Contributor Author

CkovMk commented Nov 20, 2024

@dleach02 To be honest I'm not sure what to do with these changes either. The drivers it's trying to replace works well enough on boards with them, and replacing them requires much testing efforts. Hopefully this pr would draw some attention from developers who are using old drivers, and they may want to give it a try. We can't force the deprecation, after all.

pca95xx driver can be replaced by pca_series driver, which covers a
larger number of devices.

Signed-off-by: Chekhov Ma <[email protected]>
pca953x driver can be replaced by pca_series driver, which covers a
larger number of devices.

Signed-off-by: Chekhov Ma <[email protected]>
add support for pca9574 and pca9575 devices

Signed-off-by: Chekhov Ma <[email protected]>
add support for pca9538, pcal9539, pcal6408a and pcal6416a devices

Signed-off-by: Chekhov Ma <[email protected]>
pcal64xxa driver can be replaced by pca_series driver, which covers a
larger number of devices.

Signed-off-by: Chekhov Ma <[email protected]>
@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch from e6d0c9a to 80608a5 Compare November 20, 2024 08:37
pca_series driver replaces pca953x, pca95xx and pcal64xxa drivers.

Signed-off-by: Chekhov Ma <[email protected]>
@CkovMk CkovMk force-pushed the pr/gpio-pca-series_retire_nxp,pca95xx branch from 80608a5 to 3020519 Compare November 20, 2024 08:38
@dleach02
Copy link
Member

actually, if appropriate, we can start the deprecation of these drivers. Zephyr has a process to do this. But if you don't want to take this on or don't have the means to test then lets close this PR.

@CkovMk
Copy link
Contributor Author

CkovMk commented Dec 3, 2024

let's close it then. I don't have resource to test boards from other vendor.

Please note this PR also contains some enablement code to devices it tends to replace. It's not added directly because I want to reuse existing "compatiable" statements. If other people take this task, this pr would serve as a reference.

Thanks!

@dleach02
Copy link
Member

closing per request

@dleach02 dleach02 closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO platform: Ezurio platform: Microchip MEC Microchip MEC Platform platform: NXP Drivers NXP Semiconductors, drivers platform: TI SimpleLink Texas Instruments SimpleLink MCU Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants